<template>
	<view class="container">
		<scroll-view class="examine-box" scroll-y style="height:100vh;">
			<!-- 个人信息 -->
			<view class="person-info info">
				<view class="title">个人信息</view>
				<!-- 信息 -->
				<view class="content">
					<view class="row-list">
						<text class="label">姓名:</text>
						<text>{{data.xm | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label">身份证号:</text>
						<text>{{data.zjhm | rp}}</text>
					</view>
					<view class="row-list">
						<text class="label">籍贯:</text>
						<text>{{data.jg | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label">联系电话:</text>
						<text>{{data.lxdh | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label">居住村社:</text>
						<text>{{data.jwhName | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label">居住详址:</text>
						<text>{{data.address | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label">工作地址:</text>
						<text>{{data.workAddress | tp}}</text>
					</view>
				</view>
			</view>
			<!-- 反穗情况 -->
			<view class="info">
				<view class="title">返穗情况</view>
				<view v-if="data.alwaysInGz==1" class="content">
					<view class="row-list">一直在穗</view>
				</view>
				<!-- 信息 -->
				<view v-else class="content">
					<view class="row-list">
						<text class="label">返穗日期:</text>
						<text>{{data.returnTime | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label">出发地:</text>
						<text>{{data.departAddress | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label" style="padding-right:8px;">返穗交通工具:</text>
						<text>{{data.vehicle_dict | tp}}</text>
					</view>
					<view class="row-list">
						<text class="label" style="padding-right:8px;">车牌/车次/航班号:</text>
						<text>{{data.vehicleNum | tp}}</text>
					</view>
				</view>
			</view>
			<!--  -->
			<!-- <view class="padding">
				<button class="cu-btn block bg-blue margin-tb-sm lg" @click.stop="navPerson">修改个人信息</button>
			</view> -->
		</scroll-view>
		<!-- 消息提示组件 -->
		<message ref="Message" :duration="2000" background></message>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 获取保存的个人出入数据
				data : ""
			};
		},
		onLoad() {
			//初始加载个人信息
			this.lodaPersonInfo();
		},
		methods: {
			//初始加载个人信息
			async lodaPersonInfo(){
				uni.showLoading({
					mask:true,
				    title: "正在加载中"
				});
				let result = await this.$request.post(this.$api.getMyInfo,{"openId":this.$store.state.openId});
				// 
				if(result.appCode == 1){
					let _this = this;
					this.data = result.data;
					// 保存用户登记数据到状态用户数据回显
					this.$store.dispatch('refreshRegisterData',result.data);
				}else{
					this.$refs['Message'].error(result.appMsg);
				}
				uni.hideLoading();
			},
			// 跳转到登记页面
			navPerson(){
				this.$routes.navTo('/pages/EPass/EPassIndex');
			}
			
		}
	}
</script>

<style lang="scss">
	page {
		background: #fff;
		height: 100%;
		.person-info{
			border-bottom:1px solid $b-t;
			
		}
		.info{
			padding: 40rpx 30rpx;
			.title{
				font-size: $fz18;
			}
			// 列表
			.row-list{
				display: flex;
				padding-top: 10px;
				align-items:baseline;
				.label{
					min-width: calc(4em + 15px);
					color: $color6;
				}
			}
		}
	}
</style>
